#ifndef __WINDIB_H__
#define __WINDIB_H__

#include "./winhdr.h"
#include "miniui/minitypes.h"

namespace MiniUI
{

class WinDIB
{
public:
    WinDIB();
    ~WinDIB();
    void Rebuild(int cx, int cy);
    void CopyBits(lpvoid pBits, const Type::MiniRect& rcDst);
    byte* GetData();
    operator HDC() { return m_hDC; }
    operator HBITMAP() { return m_hDIB; }
protected:
    void CreateDevice();
protected:
    HDC m_hDC;
    BITMAPINFO m_bmpInfo;
    HBITMAP m_hDIB;
    byte* m_lpByte;
};

}

#endif